package org.flown.shop.controller;

import org.flown.shop.entity.Store;
import org.flown.shop.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


@RequestMapping("/store")
public class StoreController
{
    @Autowired
    private StoreService service_store;


    @ResponseBody
    @RequestMapping({"/getStoreByID", "/{id}"})
    public Store getStoreByID(@PathVariable @RequestParam int id) {return this.service_store.getStoreByID(id);}
    @ResponseBody
    @RequestMapping({"/getStoreBySellerID", "/seller/{seller_id}"})
    public Store getStoreBySellerID(@PathVariable @RequestParam("id") int seller_id) {return this.service_store.getStoreBySellerID(seller_id);}
    @ResponseBody
    @RequestMapping({"/getStoreByName", "/name/{name}"})
    public Store getStoreByName(@PathVariable @RequestParam String name) {return this.service_store.getStoreByName(name);}
}



